//
//  ZGWCommunityViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/6/13.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "ZGWCommunityViewController.h"
#import "ZGWHuDongViewController.h"

@interface ZGWCommunityViewController ()

@end

@implementation ZGWCommunityViewController

- (void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self changePage];
    
}

- (void)changePage
{
    self.navigationItem.title = @"社区";
    UIButton *hudongButton = [UIButton buttonWithType:UIButtonTypeSystem];
    hudongButton.backgroundColor = [UIColor cyanColor];
    hudongButton.frame = CGRectMake(100, 100, 100, 100);
    [hudongButton setTitle:@"互动" forState:UIControlStateNormal];
    [hudongButton addTarget:self action:@selector(hudong:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:hudongButton];
    // iOS7.0以后需要这样设置
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:22]};
    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:84 / 255.0 green:199 / 255.0 blue:222 / 255.0 alpha:1]];
}

- (void)hudong:(UIButton *)button
{
    ZGWHuDongViewController *huDongVC = [[ZGWHuDongViewController alloc] init];
    [self.navigationController pushViewController:huDongVC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
